package 暑假实习面试.腾讯面试题;

public class No6 {

    //518. 零钱兑换II  组合数,钱在外

    public int change(int amount, int[] coins) {

        int[] dp=new int[amount+1];
        dp[0]=1;

        for (int coin : coins) {
            for (int i = 1; i <= amount; i++) {
                if(i<coin){
                    continue;
                }
                dp[i]+=dp[i-coin];
            }
        }

        return dp[amount];
    }

}
